package com.yunda.nebula.gateway.config;

import com.yunda.nebula.gateway.filter.IpHashBalancerClientFilter;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.cloud.gateway.config.LoadBalancerProperties;
import org.springframework.cloud.gateway.filter.LoadBalancerClientFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * \* User: wei.zhang
 * \* Date: 2019/12/25 16:25
 * \* Description:
 *
 * @author wei.zhang
 * \
 */
@Configuration
public class LoadBalancedConfig {
    @Bean
    public LoadBalancerClientFilter LoadBalancerClientFilter(LoadBalancerClient client, LoadBalancerProperties properties) {
        return new IpHashBalancerClientFilter(client, properties);
    }

}
